package com.jni.riyada;

import com.jni.model.Article;
import com.jni.utils.ImageLoader;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;

public class Article_details extends Activity {

	private TextView title;
	private TextView content;

	private Article article;

	private ImageLoader imageLoader;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		// handle intent extra
		Intent i = getIntent();
		Article article = (Article) i.getSerializableExtra("articleObject");

		imageLoader = new ImageLoader(Article_details.this);

		setContentView(R.layout.article_details);
		title = (TextView) (findViewById(R.id.article_title));
		title.setText(article.title);

		ImageView picture = (ImageView) (findViewById(R.id.picture));
		imageLoader.DisplayImage(article.picture, picture);
		picture.getLayoutParams().width = 400;
		picture.getLayoutParams().width = 300;

		content = (TextView) (findViewById(R.id.article_content));
		Log.i("content", article.content);
		content.setText(article.content.replace(";nbsp&", " ").replace(
				"&nbsp;", " "));

	}

}
